package cn.liberals.system.service.impl;

import cn.liberals.basic.service.impl.BaseServiceImpl;
import cn.liberals.basic.utils.PageList;
import cn.liberals.org.mapper.EmployeeMapper;
import cn.liberals.system.domain.Dictionarydetail;
import cn.liberals.system.domain.Dictionarytype;
import cn.liberals.system.mapper.DictionarydetailMapper;
import cn.liberals.system.query.DictionarydetailQuery;
import cn.liberals.system.service.IDictionarydetailService;
import cn.liberals.system.service.IDictionarytypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
// 只读事务
@Transactional(readOnly = true, propagation = Propagation.SUPPORTS)
public class DictionarydetailServiceImpl extends BaseServiceImpl<Dictionarydetail> implements IDictionarydetailService {

    @Autowired
    private DictionarydetailMapper dictionarydetailMapper;


    @Override
    public PageList<Dictionarydetail> dictionaryDetailList(DictionarydetailQuery dictionarydetailQuery) {
        List<Dictionarydetail> systemDictionaryDetails = dictionarydetailMapper.dictionarydetailList(dictionarydetailQuery);
        Integer totals = dictionarydetailMapper.queryCount(dictionarydetailQuery);
        return new PageList<Dictionarydetail>(totals, systemDictionaryDetails);
    }
}
